
<template>
  <el-select v-model="jbrKeyId" size="small" style="width:100%" filterable clearable @change="returnChange" placeholder="请选择经办人" >
    <el-option 
      v-for="item in jbrList" 
      :key="item.jbrId" 
      :label="item.jbrName" 
      :value="item.jbrId">
    </el-option>
  </el-select>
</template>

<script>
import { listJingbanren } from "@/api/erp/system/jingbanren";

export default {
  data() {
    return {
      jbrList : [],
      jbrKeyId : '',
    };
  },
  model:{
    prop:'jbrId',
    event: 'change'
  },
  watch:{
    jbrId : function(newValue, oldValue){
      this.jbrKeyId = newValue;
    }
  },
  props: {
    jbrId: 0,
  },
  methods: {
    returnChange(){
      this.$emit('change', this.jbrKeyId);
    },
  },
  created() {
      listJingbanren().then((response) => {
          this.jbrList = response.rows;
      });
  },
};
</script>
